100 REM Sample BASIC program that calls SORTRES
110 OPEN "SORTIBAS.SEG" FOR INPUT AS #1
120 INPUT #1, SEGADDR
130 DEF SEG   = SEGADDR
140 INFILE$   = "SAMP.DAT"
150 OUTFILE$  = "SORTED.DAT"     
160 CTLSTMT$  = "S(1,10,C,A)"
170 SORTIBAS=0
180 PRINT "CALLING OPT-TECH SORT..."
190 CALL SORTIBAS(INFILE$,OUTFILE$,CTLSTMT$,NUMRECS%,RETCODE%)
200 PRINT "BACK FROM OPT-TECH SORT"
210 PRINT "NUMBER OF RECORDS = ",NUMRECS%
220 PRINT "SORT STATUS       = ",RETCODE%
230 END
